#include "game.h"

game::game(QObject *parent) :
    QObject(parent)
{
    QMessageBox colorMsg, turnMsg;

    colorMsg.setText("Which color would you like?");
    colorMsg.addButton("Red", QMessageBox::RejectRole);
    colorMsg.addButton("Green", QMessageBox::AcceptRole);

    if(colorMsg.exec())
    {
        human = Qt::green;
        cpu = Qt::red;
    }
    else
    {
        human = Qt::red;
        cpu = Qt::green;
    }

    turnMsg.setText("Would you like to go first?");
    turnMsg.addButton("Yes", QMessageBox::AcceptRole);
    turnMsg.addButton("No", QMessageBox::RejectRole);

    if(turnMsg.exec())
    {
        player = P1;
    }

    else
    {
        player = P2;
    }

    colorMsg.close();
    turnMsg.close();

    for(int i = 0; i < 10; i++)
    {
        for(int j = 0; j < 10; j++)
        {
            pieces[i][j].color = Qt::white;
            pieces[i][j].player = 0;
        }
    }
}

void game::checkState()
{
    for(int i = 0; i < 10; i++)
    {
        for(int j = 0; j < 10; j++)
        {
            // Check for win first

            // Then check for loss
        }
    }
}

